<template>
    <div>
        <h2>修改等级</h2>
        <p>修改等级名：<input type="text" v-model="grade"></p>
        <p><input type="button" value="修改" @click="updategrade"></p>
    </div>
</template>


<script>
import axios from 'axios'
export default {
    data() {
        return {
            gid:this.$route.params.gid,
            grade:'',
        }
    },
    methods:{
        updategrade(){
            let form_data = new FormData()
            form_data.append("gid",this.gid)
            form_data.append("grade",this.grade)
            axios({
                url:"http://127.0.0.1:8000/app01/gradeapi/",
                method:"put",
                data:form_data
            }).then(res=>{
                console.log(res)
            })
        }
    },
    created() {

    }
}
</script>